/* weather.css  */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --accent: #4a5568;
    --error-bg: #fff5f5;
    --error-text: #c53030;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-gradient: linear-gradient(135deg, #434190 0%, #1a365d 100%);
        --card-bg: rgba(26, 32, 44, 0.95);
        --text-primary: #cbd5e0;
        --text-secondary: #a0aec0;
        --accent: #718096;
        --error-bg: #2d2d2d;
        --error-text: #fc8181;
    }
}

body {
  
          -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;    /* Firefox */
        -ms-text-size-adjust: 100%;     /* Internet Explorer */
        text-size-adjust: 100%;         /* 标准语法 */
  
}



.weather-card {
    position: relative;
    width: 100%;
    border-radius: 24px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    overflow: hidden;
    transform-style: preserve-3d;
    transition: var(--transition);
}

.weather-card:hover {
    transform: translateY(-5px) rotateX(1deg) rotateY(-1deg);
}

/* 加载状态 */
.loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--text-secondary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* 正常内容 */
.content {
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-primary);
}

.last-updated {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.main-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 1rem; */
}

.weather-art {
    position: relative;
    width: 95px;
    height: 95px;
}

.weather-icon {
    position: absolute;
    font-size: 4rem;
    color: var(--text-primary);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.temperature-wrapper {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.temperature {
    font-size: 3rem;
    font-weight: 300;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.unit {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.weather-meta {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    background: rgba(160, 174, 192, 0.1);
    padding: 0.3rem;
    border-radius: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.meta-item i {
    font-size: 1.25rem;
    color: var(--accent);
}

.value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.label {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.divider {
    width: 1px;
    background: rgba(113, 128, 150, 0.3);
}

/* 错误状态 */
.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--error-bg);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.error-content {
    text-align: center;
    padding: 2rem;
}

.error-message {
    color: var(--error-text);
    margin: 1rem 0;
    font-weight: 500;
}

.retry-btn {
    background: none;
    border: 2px solid var(--error-text);
    color: var(--error-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.retry-btn:hover {
    background: var(--error-text);
    color: white;
}

.welcome-message {
    position: relative;
    bottom: -10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    /* padding: 10px 0 0px 0; */
    line-height: 1.4;
} 


@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 天气粒子效果 */
#weatherCanvas {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
